package com.session01;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class TestDemo {
    public static void main(String[] args) {
        try {
            int[] arr = new int[1024 * 1024 * 1024];

        } catch (StackOverflowError e) {
            System.out.println("eeeeee");
        }catch (OutOfMemoryError e1){
            System.out.println("aaaaaa");
        }
    }

    public class ExceptionDemo {
        public void testCheck() {
            FileInputStream fis = null;
            String strDir = "";
            Error error = new Error();
            strDir = this.getClass().getResource("").getPath();
            try {
                fis = new FileInputStream(strDir + "1.txt");
            } catch (FileNotFoundException e1) {
                e1.printStackTrace();
            } finally {
                try {
                    fis.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }



}
